package com.hzhr.iot.device.controller;

import com.hzhr.iot.core.annotation.ApiImplicitInternalParams;
import com.hzhr.iot.core.annotation.Author;
import com.hzhr.iot.core.dto.ResponseExceptionDto;
import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.device.controller.base.BaseController;
import com.hzhr.iot.device.model.pressureMonitor1.PressureMonitor1GetModel;
import com.hzhr.iot.device.model.pressureMonitor1_collectData.PressureMonitor1_CollectDataGetModel;
import com.hzhr.iot.device.service.PressureMonitor1Service;
import com.hzhr.iot.device.service.PressureMonitor1_CollectDataService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Map;

@Api(tags = "PressureMonitor1_CollectData", description = "压力监测仪1的采集数据")
@RestController
@RequestMapping(value = "")
public class PressureMonitor1_CollectDataController extends BaseController {
    @Autowired
    PressureMonitor1_CollectDataService pressureMonitor1_collectDataService;

    //region /pressure-monitor1s/{pressureMonitor1Id}/collect-datas GET
    //region swagger响应码 : get
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
            @ApiResponse(code = 403, message = "----异常代码 : 201  \n----异常类型 : 业务流程异常  \n----异常业务 : 查询压力检测仪  \n----异常说明 : 压力监测仪不存在  \n\n", response = ResponseExceptionDto.class),
    })
    //endregion
    //region swagger说明 : get
    @ApiOperation(value="查询加装在用户管辖范围内的调压箱柜上的压力检测仪所采集的数据(根据采集时间降序排列)", notes="查询加装在用户管辖范围内的调压箱柜上的压力检测仪所采集的数据(根据采集时间降序排列)  \n步骤 :  \n1. 查询压力检测仪：查询加装在用户管辖范围内的调压箱柜上的压力检测仪，如果不存在则抛出异常“压力监测仪不存在”  \n2. 查询压力检测仪所采集的数据(根据采集时间降序排列)  \n3. 返回信息  \n",produces = "application/json")
    //endregion
    //region swagger参数 : get
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "greaterthanorequal_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime >= #{greaterthanorequal_collectTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "greaterthan_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime > #{greaterthan_collectTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "lessthanorequal_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime <= #{lessthanorequal_collectTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "lessthan_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime < #{lessthan_collectTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "equal_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime = #{equal_collectTime}",required = false, dataType = "long", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_dept", value = "是否展示部门信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthanorequal_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime >= #{_greaterthanorequal_collectTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthan_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime > #{_greaterthan_collectTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "_lessthanorequal_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime <= #{_lessthanorequal_collectTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "_lessthan_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime < #{_lessthan_collectTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "_equal_collectTime", value = "筛选条件 : where PressureMonitor1Model.collectTime = #{_equal_collectTime}",required = false, dataType = "long", paramType = "query"),

    })
    //endregion
    //region 请求 : get
    @RequestMapping(value = "/pressure-monitor1s/{pressureMonitor1Id}/collect-datas", method = RequestMethod.GET)
    //endregion
    @Author
    public ResponseEntity<PressureMonitor1_CollectDataGetModel> get(@PathVariable("pressureMonitor1Id") Integer pressureMonitor1Id,
                                                                    @RequestParam @ApiIgnore Map<String, Object> query) throws ServiceException {
        PressureMonitor1_CollectDataGetModel responseBody = pressureMonitor1_collectDataService.get(initHeader(), pressureMonitor1Id, query);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
    }
    //endregion

}
















































































































































































































































































































































































































































































































































































































































































